package com.ruoyi.sl.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sl.mapper.SlLevelMapper;
import com.ruoyi.common.core.domain.entity.SlLevel;
import com.ruoyi.sl.service.ISlLevelService;

/**
 * 级别Service业务层处理
 * 
 * @author admin
 * @date 2024-06-03
 */
@Service
public class SlLevelServiceImpl implements ISlLevelService 
{
    @Autowired
    private SlLevelMapper slLevelMapper;

    /**
     * 查询级别
     * 
     * @param levelId 级别主键
     * @return 级别
     */
    @Override
    public SlLevel selectSlLevelByLevelId(Long levelId)
    {
        return slLevelMapper.selectSlLevelByLevelId(levelId);
    }

    /**
     * 查询级别列表
     * 
     * @param slLevel 级别
     * @return 级别
     */
    @Override
    public List<SlLevel> selectSlLevelList(SlLevel slLevel)
    {
        return slLevelMapper.selectSlLevelList(slLevel);
    }

    /**
     * 查询所有职级
     *
     * @return 职级集合
     */
    @Override
    public List<SlLevel> selectLevelAll(){
        return slLevelMapper.selectLevelAll();
    }


    /**
     * 新增级别
     * 
     * @param slLevel 级别
     * @return 结果
     */
    @Override
    public int insertSlLevel(SlLevel slLevel)
    {
        slLevel.setCreateTime(DateUtils.getNowDate());
        return slLevelMapper.insertSlLevel(slLevel);
    }

    /**
     * 修改级别
     * 
     * @param slLevel 级别
     * @return 结果
     */
    @Override
    public int updateSlLevel(SlLevel slLevel)
    {
        slLevel.setUpdateTime(DateUtils.getNowDate());
        return slLevelMapper.updateSlLevel(slLevel);
    }

    /**
     * 批量删除级别
     * 
     * @param levelIds 需要删除的级别主键
     * @return 结果
     */
    @Override
    public int deleteSlLevelByLevelIds(Long[] levelIds)
    {
        return slLevelMapper.deleteSlLevelByLevelIds(levelIds);
    }

    /**
     * 删除级别信息
     * 
     * @param levelId 级别主键
     * @return 结果
     */
    @Override
    public int deleteSlLevelByLevelId(Long levelId)
    {
        return slLevelMapper.deleteSlLevelByLevelId(levelId);
    }
}
